<%-- 
    Document   : viewModule
    Created on : Jan 10, 2012, 5:19:24 AM
    Author     : olivier
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>

<script>
    $(function() {
        $( "#tabs" ).tabs(
        {
            ajaxOptions: {
                beforeSend: function () {
                    $('#loading').show();
            
                },
                complete: function () {
                    $('#loading').hide();
                }
            }
        }    
    );
        $( "#saveButton").button({icons: {primary:'ui-icon-disk'}});
        $( "#saveButton").click ( function () {
            $('#moduleForm').submit();
        });
        $( "#deleteButton").button({icons: {primary:'ui-icon-trash'}});
        $( "#deleteButton").click( function () {
            if (!confirm('Do you really want to delete this module?'))
                return;
            window.location.href = '<s:url value="/module/delete_%{module.moduleCode}.action"/>';
        });
        
        
    <s:if test="usersfile != null">
            $('#tabs').tabs( "select" ,2);
    </s:if>
        
        });
</script>
<br/>
<table>
    <tr>
        <td>
            <img src="<s:url value="/img/icons/component.png"/>"> 
        </td>
        <td>
            <span class="title">
                Module <s:property value="module.moduleCode"/>
            </span>
        </td>
    </tr>
</table>
<br/><br/>
<div id="loading">
    <center>
        <div>
            Loading...<br/><img src="<s:url value="/img/loading.gif"/>" style="padding:10px;" border="0"/>
        </div>
    </center>
</div>
<div style="width:800px;">

    <div id="tabs">
        <ul>
            <li><a href="#details">Module Details</a></li>
            <li><a href="<s:url value="/team/create_%{module.moduleCode}"/>">Teams</a></li>
            
        </ul>
        <div id="details">
            <s:form namespace="/module" action="update_%{module.moduleCode}" id="moduleForm">
                <s:actionerror/>
                <table>
                    <tr>
                        <td valign="top">Module Code:</td>
                        <td>${module.moduleCode}
                        </td>
                    </tr> 
                    <tr>
                        <td>Title:</td>
                        <td>${module.title}</td>
                    </tr> 
                    <tr>
                        <td>Description:</td>
                        <td>${module.description}</td>
                    </tr> 
                    <tr>
                        <td>Type:</td>
                        <td>${module.type}</td>
                    </tr>
                    <tr>
                        <td>Maximum Mark:</td>
                        <td>${module.maximumMarks}</td>
                    </tr>
                    <tr>
                        <td>Weight:</td>
                        <td>${module.weight}</td>
                    </tr>
                    <tr>
                        <td>Range:</td>
                        <td>${module.fromRange} - ${module.toRange}
                        </td>
                    </tr>
                    <tr>
                        <td>Owner:</td>
                        <td>${module.owner}</td>
                    </tr>
                    <tr>
                        <td>Lecturers:</td>
                        <td><s:select name="lecturers" list="lecturerNames" multiple="true"/></td>
                    </tr>

                </table>


            </s:form>
        </div>
    </div>

</div>

